<?php
abstract class CreatimeTree extends CActiveRecord
{
	protected function beforeValidate()
    {   		
		if($this->isNewRecord)
		{
            $this->date_post=$this->date_update=new CDbExpression('NOW()');
            $this->id_user=Yii::app()->user->id;
        }
		else
		{   
	       	$this->date_update=new CDbExpression('NOW()');
		}		
		return parent::beforeValidate();

	}
	
}
